<!-- 投诉历史记录 -->
<template>
  <div class="complaintHistory">
    <!-- 标题栏 -->
    <myheader title="小区投诉记录" rightBtn="主页" @updataInfo="submitRecruit"></myheader>

    <!-- 内容 -->
    <div v-if="!empty" class="repair_item">
      <timeHistory :repairHistoryList="complaintHistoryList"></timeHistory>
    </div>
    <van-empty v-else image="error" description="暂无记录" />
  </div>
</template>

<script>
import myheader from '../../../comon/myheader.vue'
import timeHistory from '../../../comon/timeHistory.vue'
export default {
  components: {
    myheader,
    timeHistory,
  },
  data() {
    return {
      complaintHistoryList: [],
    }
  },
  created() {
    this.init()
  },
  methods: {
    async init() {
      const res = await this.$axios.get('/property/complaint/list')
      if ((res.data.code = 200)) {
        this.complaintHistoryList = res.data.data.records
        this.empty = false
      } else {
        this.empty = true
      }
      console.log(this.complaintHistoryList)
    },

    submitRecruit() {
      this.$router.push('/home')
    },
  },
}
</script>

<style scoped>
.complaintHistory_ul {
  padding: 3%;
}
.repair_item {
  margin-top: 75px;
}
</style>
